package com.example.johnsun.mytestapp.activity;

import android.app.Activity;
import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.WindowManager;
import android.widget.TextView;

import com.example.johnsun.mytestapp.R;
import com.example.johnsun.mytestapp.my.utils.MyAppliacation;

public class CustomUI extends Activity {
    TextView textView;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fragment_choice4);


        WindowManager  mWMgr =
                (WindowManager) MyAppliacation.maPP.getSystemService(Context.WINDOW_SERVICE);
        int width = mWMgr.getDefaultDisplay().getWidth();
        int height = mWMgr.getDefaultDisplay().getHeight();

//        DisplayMetrics displayMetrics = new DisplayMetrics();
//        getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);
//        int displayWidth = displayMetrics.widthPixels;
//        int displayHeight = displayMetrics.heightPixels;

        Configuration config = getResources().getConfiguration();

        int smallestScreenWidth = config.smallestScreenWidthDp;


        textView= (TextView) findViewById(R.id.texView_choice4_fragment);
        textView.setText("displayWidth  "+width+ "  displayHeight  "+height +" smallestScreenWidth "+smallestScreenWidth);
    }
}
